package CommonEvent;

import io.appium.java_client.android.AndroidDriver;
import static Utils.MyLogger.logInfo;
/**
 * @author 锄禾
 * @projectName MkPack
 * @description: TODO
 */
public class MonkeyHomeEvent extends MonkeyEvent {
    public static AndroidDriver androidDriver;
    public static int lanchTime = 5;

    public MonkeyHomeEvent(AndroidDriver driver){
        super(MonkeyEvent.EVENT_TYPE_HOMEKEY);
        androidDriver = driver;
    }

    public int injectEvent() throws Exception{
        androidDriver.closeApp();
        androidDriver.launchApp();
        logInfo("app重启成功！");
        return MonkeyEvent.INJECT_SUCCESS;
    }
}
